{{#>base title=data.page.summary}}

    {{#*inline "pageContent"}}
        <div class="row">
            <div class="col-md-12">
                <h3 class="page-title">
                    {{data.page.summary}}
                </h3>
                <div class="tabs-wrap">
                    <ul class="nav nav-tabs">
                        <li class="active">
                            <a href="summary.html">基础</a>
                        </li>
                        <li>
                            <a href="summary-pro.html">高级</a>
                        </li>
                        <li>
                            <a href="summary-options.html">参数说明</a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-md-12">
                <div id="summaryTest" class="summary-wrap"></div>
            </div>
        </div>

        <div class="row">
            <div class="col-md-12">
                <div class="markdown">
                    <h3>HTML代码</h3>
                    <pre><code class="html">&lt;div id="summaryTest" class="summary-wrap"&gt;&lt;/div&gt;</code></pre>
                    <h3>javascript代码</h3>
<pre><code class="javascript">require('../../widgets/summary/module');
var getColumns = function () {
    var columns = [];

    columns.push({
    "cName": "showCounts",
    "title": "展示次数"
    });

    columns.push({
    "cName": "clickCounts",
    "title": "点击次数(CLK)"
    });

    columns.push({
    "cName": "viewCounts",
    "title": "访问次数(VV)"
    });

    columns.push({
        "cName": "pageView",
        "title": "浏览量(PV)"
    });

    columns.push({
        "cName": "bounceRate",
        "title": "跳出率"
    });

    columns.push({
        "cName": "avgDayView",
        "title": "平均日浏览次数"
    });

    columns.push({
        "cName": "avgViewDeep",
        "title": "平均页面访问深度"
    });

    return columns;
};

var getRows = function () {
    var rows = [];
    rows.push({
        "dataName": "title",
        "isTitle": true,
        "klass": "summary-span-title"
    });

    rows.push({
        "dataName": "value",
        "klass": "summary-span-value"
    });

    rows.push({
        "dataName": "increase",
        "tpl": "增长数:{0}"
    });

    rows.push({
        "dataName": "rate",
        'render': function (data, full) {
            var num = (Math.round(data * 10000) / 100).toFixed(2),
            _html = "";
            _html = num >= 0 ? ('&lt;span class="summary-span-rate add"&gt;+' + num + '%&lt;/span&gt;') :
                            ('&lt;span class="summary-span-rate reduce"&gt;' + num + '%&lt;/span&gt;');
        return _html;
    }
});

return rows;
};

var option = {
    //列
    "allColumns": getColumns(),
    //行
    "allRows": getRows(),
    //数据源
    "dataSource": model.getSummaryData
};
var summary = $p.summary("#summaryTest", option);</code></pre>
                    <h3>JSON 数据</h3>
                    <a href="/test/api/summaryData.json" target="_blank">summaryData.json</a>
                </div>
            </div>
        </div>
    {{/inline}}

    {{#*inline "appScript"}}
        <script type="text/javascript">
            pagurian.call("modules/summary/app", function (app) {
                app.page.summary();
            });
        </script>
    {{/inline}}

{{/base}}
